
package com.scs.application.modules.base.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.model.CommonResult;
import com.scs.application.core.model.PageResult;
import com.scs.application.core.mvc.controller.BaseController;
import com.scs.application.modules.base.entity.CertificateSummary;
import com.scs.application.modules.base.request.CertificateSummaryQueryRequest;
import com.scs.application.modules.base.service.CertificateSummaryService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 资质汇总 controller
 */
@AllArgsConstructor
@RestController
@RequestMapping("/base/certificate_summarys")
public class CertificateSummaryController extends BaseController {

    private final CertificateSummaryService certificateSummaryService;


    @GetMapping("/page")
    public PageResult page(CertificateSummaryQueryRequest request) {
        IPage page = certificateSummaryService.page(request);
        return PageResult.ok("查询成功", page.getRecords(), page.getTotal());
    }

    @GetMapping("/list")
    public CommonResult list(CertificateSummaryQueryRequest request) {
        List<CertificateSummary> list = certificateSummaryService.list(request);
        return CommonResult.ok("查询成功", list);
    }

}
